Conversation
…text Fake store's Dispatch/SetStateAsync awaited bare inside the gate, so any call made while QueueingSynchronizationContext.RunNext had installed itself captured the queue context. A fire-and-forget dispatch (the RemoveBottomPanelState path) then parked its continuation on a queue no one pumps after the test stops draining it, holding _dispatchGate and deadlocking the test's own Dispatch forever — the ArchiveConversation_ WhenMutationCompletesOffUi hang. Real ChatStore.Dispatch awaits everything with ConfigureAwait(false) so the gate never depends on an external pump; the fake now honors the same contract, making fire-and-forget dispatches self-complete. Verified: previously-hung test 5/5 green, full ChatViewModelTests 348x3 green, full Presentation.Core suite 3316/3316 green. Co-Authored-By: Claude <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
CI 上
ArchiveConversation_WhenMutationCompletesOffUi_UpdatesTerminalPanelStateOnUiContext(ChatViewModelTests)随机挂死到超时。根因(dotnet-dump 取证闭环)
测试 fake
RecordingChatStore.Dispatch的临界区内 4 处裸await。测试泵QueueingSynchronizationContext.RunNext执行回调前会SetSynchronizationContext(this),因此泵内发起的 fire-and-forget dispatch(ChatViewModel.AcpSessionLifecycle.cs的RemoveBottomPanelState→_ = _chatStore.Dispatch(new ClearConversationRuntimeStateAction(...)))会捕获队列上下文。测试泵排空后,该孤儿续体躺在无人泵的队列里——_dispatchGate永不释放,测试随后自己的await archiveTask(内含一次 Dispatch)永久排队 → 死锁。真实
ChatStore.Dispatch对所有 await 一律.ConfigureAwait(false)(闸的释放绝不依赖外部泵,fire-and-forget 分发必须能自完成)。fake 偏离了这一契约才是病根。修复
给 fake 的
Dispatch(3 处)与SetStateAsync(1 处)补齐.ConfigureAwait(false),对齐真 store 契约。AfterDispatch回调无任何测试设置,行为面无额外影响。验证
🤖 Generated with Claude Code